package com.ace3l.legal.gwt.lawfirmportal.createproject.client;

import com.google.gwt.user.client.ui.HTMLPanel;
import com.ace3l.legal.gwt.domainmodule.client.Ace3LPageTemplate;
import com.synesthesiaconsulting.gwt.resources.client.DirectorUnit;
import com.synesthesiaconsulting.gwt.resources.client.GWTActionUnitFactory;

/**
 * Created by IntelliJ IDEA.
 * User: ageer
 * Date: Jul 26, 2008
 * Time: 4:01:22 AM
 * To change this template use File | Settings | File Templates.
 */
public class CreateProject extends Ace3LPageTemplate {


    public void init() {
        director.addModule("lawfirmportal.LawFirmPortal");
        director.addModule("lawfirmportal.CreateProject");

        director.getDirector()
                .mapAction("lawfirmportal.CreateProject.cancel", "lawfirmportal.LawFirmPortal.$SELF");

        director.getDirector()
                .mapAction("lawfirmportal.CreateProject.success", "lawfirmportal.LawFirmPortal.$SELF");

        director.getDirector().addAction("lawfirmportal.CreateProject.failure", GWTActionUnitFactory.makeNoActionUnit());
        
        DirectorUnit bodyPanelManager = director.getDirector("lawfirmportal.CreateProject")
                                                .addSubModule("bodyPanel");
        CreateProjectWidget home = new CreateProjectWidget(director.getDirector("lawfirmportal.CreateProject"));

        bodyPanelManager.addAction("startPage", GWTActionUnitFactory.makeGWTNavigationUnit(home));
        bodyPanelManager.applyActionTo("startPage",bodyPanel);
        bodyPanel.add(new HTMLPanel(director.getDirector().toHTML()));


    }
}
